//
// Created by xili on 2024/8/8 21:30.
// Go big or go home.
//
#include <iostream>

using namespace std;

class Solution {
public:
    int divisorSubstrings(int num, int k) {
        string s = to_string(num);
        int n = s.size();
        int ans = 0;
        for (int i = 0; i + k <= n; i++) {
            int temp = stoi(s.substr(i, k));
            if (temp && num % temp == 0) {
                ans++;
            }
        }
        return ans;
    }
};